40fcefb23FfQn-ZBCbcHqA0cPGqQxw tools/python/xen/sv/GenTabbed.py
40fcefb2QZAn3u3sX-M7NXBjOv5HGg tools/python/xen/sv/HTMLBase.py
40fcefb2vnfDbl4w_yCTedROPuqs0g tools/python/xen/sv/Main.py
+4186e24fZMp7_bX4f50MvUscdrST9Q tools/python/xen/sv/MigrateDomain.py
40fcefb24h-04WaHag-Tg4nxWPhTig tools/python/xen/sv/NodeInfo.py
+4186e24fb4YtJw155tNtSXXN6nEWqA tools/python/xen/sv/RestoreDomain.py
+4186e24fVXt0lfeQSAy1eiFKnPCHTg tools/python/xen/sv/SaveDomain.py
40fcefb2Sif__6AqrANeBQZZfvP-6w tools/python/xen/sv/TabView.py
41052eb8UrgtUkuJPg7oY1tutVQHsg tools/python/xen/sv/Wizard.py
40fcefb2DqteqCCZYDCvvh4Q5jBd0w tools/python/xen/sv/__init__.py
it will then add the Xen architecture files. You can tell the
makefile the location of the appropriate Linux compressed tar file by
setting the LINUX\_SRC environment variable, e.g. \\
-\verb!# LINUX_SRC=/tmp/linux-2.6.8.1.tar.bz2 make world! \\ or by
+\verb!# LINUX_SRC=/tmp/linux-2.6.9.tar.bz2 make world! \\ or by
placing the tar file somewhere in the search path of {\tt
LINUX\_SRC\_PATH} which defaults to `{\tt .:..}'. If the makefile
can't find a suitable kernel tar file it attempts to download it from
If you have an existing Linux kernel configuration that you would like
to use for domain 0, you should copy it to
-install/boot/config-2.6.8.1-xen0. During the first build, you may be
+install/boot/config-2.6.9-xen0. During the first build, you may be
asked about some Xen-specific options. We advise accepting the
defaults for these options.
Files in \path{install/boot/} include:
\begin{itemize}
\item \path{install/boot/xen.gz} The Xen 'kernel'
-\item \path{install/boot/vmlinuz-2.6.8.1-xen0} Domain 0 XenLinux kernel
-\item \path{install/boot/vmlinuz-2.6.8.1-xenU} Unprivileged XenLinux kernel
+\item \path{install/boot/vmlinuz-2.6.9-xen0} Domain 0 XenLinux kernel
+\item \path{install/boot/vmlinuz-2.6.9-xenU} Unprivileged XenLinux kernel
\end{itemize}
The difference between the two Linux kernels that are built is due to
The \path{install/boot} directory will also contain the config files
used for building the XenLinux kernels, and also versions of Xen and
XenLinux kernels that contain debug symbols (\path{xen-syms} and
-\path{vmlinux-syms-2.6.8.1-xen0}) which are essential for interpreting crash
+\path{vmlinux-syms-2.6.9-xen0}) which are essential for interpreting crash
dumps. Retain these files as the developers may wish to see them if
you post on the mailing list.
distribution. The entry should look something like the following:
\begin{verbatim}
-title Xen 2.0 / XenLinux 2.6.8.1
+title Xen 2.0 / XenLinux 2.6.9
kernel /boot/xen.gz dom0_mem=131072 com1=115200,8n1
- module /boot/vmlinuz-2.6.8.1-xen0 root=/dev/sda4 ro console=tty0 console=ttyS0
+ module /boot/vmlinuz-2.6.9-xen0 root=/dev/sda4 ro console=tty0 console=ttyS0
\end{verbatim}
The first line of the configuration (kernel...) tells GRUB where to
\item Download the ttylinux disk image from XXX where from?
\item Create a configuration file like the following:
\begin{verbatim}
-kernel = "/boot/vmlinuz-2.6.8.1-xenU" # or a 2.4 kernel or a xen0 kernel
+kernel = "/boot/vmlinuz-2.6.9-xenU" # or a 2.4 kernel or a xen0 kernel
memory = 64
name = "ttylinux"
cpu = -1 # leave to Xen to pick
\chapter{Domain Configuration Files}
\label{cha:config}
-XXX Could use a little explanation about possible values
+XX Could use a little explanation about possible values
-Xen configuration files contain the following standard variables:
+Xen configuration files contain the following standard variables.
+Unless otherwise stated, configuration items should be enclosed in
+quotes (i.e. {\tt '...'} or {\tt ``....''})):
\begin{description}
\item[kernel] Path to the kernel image (on the server).
\item[memory] Memory size in megabytes.
\item[cpu] CPU to assign this domain to.
\item[nics] Number of virtual network interfaces.
-\item[vif] List of MAC addresses (random addresses are assigned if not given).
-\item[disk] Regions of disk to export to the domain.
+\item[vif] List of MAC addresses (random addresses are assigned if not given) and /
+ or bridges to use for the domains network interfaces. e.g. \\
+ \verb_vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0', 'bridge=xen-br1' ]_
+ to assign a MAC address and bridge to the first interface and assign a
+ different bridge to the second interface, leaving Xend to choose the MAC
+ address.
+\item[disk] List of block devices to export to the domain. e.g. \\
+ \verb_disk = [ 'phy:hda1,sda1,r' ]_ \\
+ exports device \path{/dev/hda1} to the domain, as \path{/dev/sda1} with
+ readonly access being allowed. \\
+ \verb_disk = [ 'phy:hda7,sda2,w', 'phy:hdb2,sda,w!' ]_ \\
+ exports device \path{/dev/hda7} to the domain as \path{/dev/sda2} with
+ write access enabled and \path{/dev/hdb2} as \path{/dev/sda} with write access
+ force enabled (bypassing safety checks).
\item[dhcp] Set to {\tt 'dhcp'} if you want to DHCP allocate the IP address.
\item[netmask] IP netmask.
\item[gateway] IP address for the gateway (if any).
#----------------------------------------------------------------------------
# Kernel image file.
-kernel = "/boot/vmlinuz-2.6.8.1-xenU"
+kernel = "/boot/vmlinuz-2.6.9-xenU"
# Optional ramdisk.
#ramdisk = "/boot/initrd.gz"
#----------------------------------------------------------------------------
# Kernel image file.
-kernel = "/boot/vmlinuz-2.6.8.1-xenU"
+kernel = "/boot/vmlinuz-2.6.9-xenU"
# Optional ramdisk.
#ramdisk = "/boot/initrd.gz"
CreatePage4,
CreateFinish ]
- Wizard.__init__( self, urlWriter, "Create Domain Wizard", sheets )
+ Wizard.__init__( self, urlWriter, "Create Domain", sheets )
class CreatePage0( Sheet ):
def __init__( self, urlWriter ):
Sheet.__init__( self, urlWriter, "Setup Kernel Image", 1 )
- self.addControl( ListControl( 'builder', [('linux', 'Linux'), ('netbsd', 'NetBSD')], 'Kernel Type:' ) )
+# For now we don't need to select a builder...
+# self.addControl( ListControl( 'builder', [('linux', 'Linux'), ('netbsd', 'NetBSD')], 'Kernel Type:' ) )
self.addControl( FileControl( 'kernel', '/boot/vmlinuz-2.6.9-xenU', 'Kernel Image:' ) )
self.addControl( InputControl( 'extra', '', 'Kernel Command Line Parameters:' ) )
from xen.sv.NodeInfo import NodeInfo
from xen.sv.DomInfo import DomInfo
from xen.sv.CreateDomain import CreateDomain
+from xen.sv.MigrateDomain import MigrateDomain
+from xen.sv.SaveDomain import SaveDomain
+from xen.sv.RestoreDomain import RestoreDomain
from xen.xend.XendClient import server
self.modules = { "node": NodeInfo,
"list": DomList,
"info": DomInfo,
- "create": CreateDomain }
+ "create": CreateDomain,
+ "migrate" : MigrateDomain,
+ "save" : SaveDomain,
+ "restore" : RestoreDomain }
+
+ # ordered list of module menus to display
+ self.module_menus = [ "node", "create", "migrate", "save",
+ "restore", "list" ]
HTMLBase.__init__(self)
def render_POST( self, request ):
request.write( " <img src='images/xen.png' width='150' height='75' border='0'/></a><br/></td></tr>" )
request.write( " <tr><td height='60px' align='center'><p class='small'>SV Web Interface<br/>(C) <a href='mailto:tw275@cam.ac.uk'>Tom Wilkie</a> 2004</p></td></tr>")
request.write( " <tr><td align='center' valign='top'>" )
-
- for (modName, module) in self.modules.items():
- module( self.mainUrlWriter( modName ) ).write_MENU( request )
+ for modName in self.module_menus:
+ self.modules[modName]( self.mainUrlWriter( modName ) ).write_MENU( request )
+
request.write( " </td></tr>" )
request.write( " </table>" )
request.write( " " )
--- /dev/null
+from xen.sv.Wizard import *
+from xen.sv.util import *
+from xen.sv.GenTabbed import PreTab
+
+from xen.xm.create import make_config, OptVals
+
+from xen.xend.XendClient import server
+
+class MigrateDomain( Wizard ):
+ def __init__( self, urlWriter ):
+
+ sheets = [ ChooseMigrateDomain,
+ DoMigrate ]
+
+ Wizard.__init__( self, urlWriter, "Migrate Domain", sheets )
+
+
+class ChooseMigrateDomain( Sheet ):
+ def __init__( self, urlWriter ):
+ Sheet.__init__( self, urlWriter, "Configure Migration", 0)
+ try:
+ domains = server.xend_domains()
+ domains.sort()
+ except:
+ pass
+
+ domnames = []
+ for i in domains:
+ if i != 'Domain-0': domnames.append((i,i))
+
+ self.addControl( ListControl('domid',
+ domnames,
+ 'Domain ID:') )
+ self.addControl( TickControl('live',
+ 'True',
+ 'Live migrate:') )
+ self.addControl( InputControl('rate',
+ '0',
+ 'Rate limit:') )
+ self.addControl( InputControl( 'dest', 'myhost.mydomain',
+ 'Name or IP address:',
+ ".*") )
+
+class DoMigrate( Sheet ):
+ def __init__(self, urlWriter ):
+ Sheet.__init__(self, urlWriter, "Migration Done", 1)
+
+ def write_BODY( self, request, err ):
+
+ if not self.passback: self.parseForm( request )
+
+# print string2sxp(self.passback)
+
+ config = ssxp2hash ( string2sxp( self.passback ) )
+
+ try:
+ print config
+ print config['domid'], config['dest']
+ dom_sxp = server.xend_domain_migrate( config['domid'],
+ config['dest'],
+ config.get('live') == 'True',
+ config['rate'] )
+ success = "Your domain was successfully Migrated.\n"
+ except Exception, e:
+ success = "There was an error migrating your domain\n"
+ dom_sxp = str(e)
+
+ pt = PreTab( success + dom_sxp ) # sxp2prettystring( dom_sxp ) )
+ pt.write_BODY( request )
+
+ request.write( "<input type='hidden' name='passback' value=\"%s\"></p>" % self.passback )
+ request.write( "<input type='hidden' name='sheet' value='%s'></p>" % self.location )
--- /dev/null
+from xen.sv.Wizard import *
+from xen.sv.util import *
+from xen.sv.GenTabbed import PreTab
+
+from xen.xm.create import make_config, OptVals
+
+from xen.xend.XendClient import server
+
+class RestoreDomain( Wizard ):
+ def __init__( self, urlWriter ):
+
+ sheets = [ ChooseRestoreDomain,
+ DoRestore ]
+
+ Wizard.__init__( self, urlWriter, "Restore Domain", sheets )
+
+
+class ChooseRestoreDomain( Sheet ):
+ def __init__( self, urlWriter ):
+ Sheet.__init__( self, urlWriter, "Configure Restore", 0)
+
+ self.addControl( InputControl( 'file', '',
+ 'Suspend file name:',
+ ".*") )
+
+class DoRestore( Sheet ):
+ def __init__(self, urlWriter ):
+ Sheet.__init__(self, urlWriter, "Restore Done", 1)
+
+ def write_BODY( self, request, err ):
+
+ if not self.passback: self.parseForm( request )
+ config = ssxp2hash ( string2sxp( self.passback ) )
+
+ try:
+ dom_sxp = server.xend_domain_restore( config['file'] )
+ success = "Your domain was successfully restored.\n"
+ except Exception, e:
+ success = "There was an error restoring your domain\n"
+ dom_sxp = str(e)
+
+ pt = PreTab( success + sxp2prettystring( dom_sxp ) )
+ pt.write_BODY( request )
+
+ request.write( "<input type='hidden' name='passback' value=\"%s\"></p>" % self.passback )
+ request.write( "<input type='hidden' name='sheet' value='%s'></p>" % self.location )
--- /dev/null
+from xen.sv.Wizard import *
+from xen.sv.util import *
+from xen.sv.GenTabbed import PreTab
+
+from xen.xm.create import make_config, OptVals
+
+from xen.xend.XendClient import server
+
+class SaveDomain( Wizard ):
+ def __init__( self, urlWriter ):
+
+ sheets = [ ChooseSaveDomain,
+ DoSave ]
+
+ Wizard.__init__( self, urlWriter, "Save Domain", sheets )
+
+
+class ChooseSaveDomain( Sheet ):
+ def __init__( self, urlWriter ):
+ Sheet.__init__( self, urlWriter, "Configure Save", 0)
+ try:
+ domains = server.xend_domains()
+ domains.sort()
+ except:
+ pass
+
+ domnames = []
+ for i in domains:
+ if i != 'Domain-0': domnames.append((i,i))
+
+ self.addControl( ListControl('domid',
+ domnames,
+ 'Domain ID:') )
+ self.addControl( InputControl( 'file', '',
+ 'Suspend file name:',
+ ".*") )
+
+class DoSave( Sheet ):
+ def __init__(self, urlWriter ):
+ Sheet.__init__(self, urlWriter, "Save Done", 1)
+
+ def write_BODY( self, request, err ):
+
+ if not self.passback: self.parseForm( request )
+ config = ssxp2hash ( string2sxp( self.passback ) )
+
+ try:
+ dom_sxp = server.xend_domain_save( config['domid'],
+ config['file'] )
+ success = "Your domain was successfully saved.\n"
+ except Exception, e:
+ success = "There was an error saving your domain\n"
+ dom_sxp = str(e)
+
+ pt = PreTab( success + dom_sxp ) # sxp2prettystring( dom_sxp ) )
+ pt.write_BODY( request )
+
+ request.write( "<input type='hidden' name='passback' value=\"%s\"></p>" % self.passback )
+ request.write( "<input type='hidden' name='sheet' value='%s'></p>" % self.location )